import Vue from 'vue'
import Vuex from 'vuex'

let modules = {};
const CommonStores = import.meta.globEager('../Store/*.js');
for (const key in CommonStores) {
  const element = CommonStores[key];
  const _key = key.replace(/\.js/g, '').replace(/\.\.\/Store\//g, '')
  modules[_key] = element.default;
}



const moduleStores = import.meta.globEager('../../views/**/store.js');
for (const key in moduleStores) {
  const element = moduleStores[key];
  const _key = key.replace(/\/store\.js/g, '').replace(/\.\.\/\.\.\/views\//g, '').replace(/\//g, '-')
  modules[_key] = element.default;
}

Vue.use(Vuex);
export default new Vuex.Store({
  modules,
  plugins: [],
  strict: false
})
